package com.ruoyi.group.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.group.mapper.HouseGroupTMapper;
import com.ruoyi.group.domain.HouseGroupT;
import com.ruoyi.group.service.IHouseGroupTService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 楼宇管理Service业务层处理
 * 
 * @author lijie
 * @date 2023-04-19
 */
@Service
public class HouseGroupTServiceImpl implements IHouseGroupTService 
{
    @Autowired
    private HouseGroupTMapper houseGroupTMapper;

    /**
     * 查询楼宇管理
     * 
     * @param groupId 楼宇管理主键
     * @return 楼宇管理
     */
    @Override
    public HouseGroupT selectHouseGroupTByGroupId(Long groupId)
    {
        return houseGroupTMapper.selectHouseGroupTByGroupId(groupId);
    }

    @Override
    public HouseGroupT selectGroup(HouseGroupT houseGroupT) {
        return houseGroupTMapper.selectGroup(houseGroupT);
    }

    /**
     * 查询楼宇管理列表
     * 
     * @param houseGroupT 楼宇管理
     * @return 楼宇管理
     */
    @Override
    public List<HouseGroupT> selectHouseGroupTList(HouseGroupT houseGroupT)
    {
        return houseGroupTMapper.selectHouseGroupTList(houseGroupT);
    }

    /**
     * 新增楼宇管理
     * 
     * @param houseGroupT 楼宇管理
     * @return 结果
     */
    @Transactional
    @Override
    public int insertHouseGroupT(HouseGroupT houseGroupT)
    {
        return houseGroupTMapper.insertHouseGroupT(houseGroupT);
    }

    /**
     * 修改楼宇管理
     * 
     * @param houseGroupT 楼宇管理
     * @return 结果
     */
    @Transactional
    @Override
    public int updateHouseGroupT(HouseGroupT houseGroupT)
    {
        houseGroupTMapper.updateHouseGroupUnitT(houseGroupT);
        houseGroupTMapper.updateHouseGroupDoorT(houseGroupT);
        return houseGroupTMapper.updateHouseGroupT(houseGroupT);
    }

    @Transactional
    @Override
    public int moveHouseGroupT(HouseGroupT houseGroupT)
    {
        HouseGroupT houseGroupVO = new HouseGroupT();
        houseGroupTMapper.updateHouseGroupUnitT(houseGroupT);
        houseGroupTMapper.updateHouseGroupDoorT(houseGroupT);
        return houseGroupTMapper.updateHouseGroupT(houseGroupT);
    }

    /**
     * 批量删除楼宇管理
     * 
     * @param groupIds 需要删除的楼宇管理主键
     * @return 结果
     */
    @Transactional
    @Override
    public int deleteHouseGroupTByGroupIds(Long[] groupIds)
    {
        return houseGroupTMapper.deleteHouseGroupTByGroupIds(groupIds);
    }

    /**
     * 删除楼宇管理信息
     * 
     * @param groupId 楼宇管理主键
     * @return 结果
     */
    @Transactional
    @Override
    public int deleteHouseGroupTByGroupId(Long groupId)
    {
        return houseGroupTMapper.deleteHouseGroupTByGroupId(groupId);
    }

    @Override
    public HouseGroupT getDoorNumber(HouseGroupT houseGroupT) {
        return houseGroupTMapper.getDoorNumber(houseGroupT);
    }


    @Override
    public HouseGroupT getGroupCost(HouseGroupT houseGroupT) {
        return houseGroupTMapper.getGroupCost(houseGroupT);
    }


    @Override
    public HouseGroupT getMust(HouseGroupT houseGroupT) {
        return houseGroupTMapper.getMust(houseGroupT);
    }


    @Override
    public HouseGroupT getAlready(HouseGroupT houseGroupT) {
        return houseGroupTMapper.getAlready(houseGroupT);
    }

    @Override
    public List<HouseGroupT> selectHouseGroupTByGroupName(HouseGroupT houseGroupT) {
        return houseGroupTMapper.selectHouseGroupTByGroupName(houseGroupT);
    }

}
